<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<!DOCTYPE html>
<html lang="en">
<head>
<title><s:message code="app.title" /></title>
<%@ include file="Include.jsp"%>
<script type="text/javascript">
	
	$(document).ready(function() {
	
		$("[data-toggle=modal]").click(function(ev) {
			ev.preventDefault();
			
			// load the url and show modal on success
			$( $(this).attr('data-target') ).load($(this).attr("href"), function() {
				$($(this).attr('data-target')).modal("show");
			});
			
		});
	
	});
	
	
</script>
</head>
<body>
	<div class="container">
		<%@ include file="Menu.jsp"%>
		<h2><s:message code="containerForm.editheader" /></h2>
		<hr>
		<form:form id="cancelForm">
		</form:form>
		<form:form class="form-horizontal" method="post" name="containerForm" id="containerForm" commandName="containerForm"
	           modelAttribute="containerForm" >
	           <form:hidden path="containerid" cssClass="input-medium" id="containerid" /> 
	        <form:errors cssClass="text-error" path="*" />
			<table class="table table-bordered">
				<tr>
					<th><form:label path="containerno"><s:message code="containerForm.containerno"/></form:label></th>
					<td>
						<form:input path="containerno" cssClass="input-large" id="containerno" maxlength="50" size="30" type="text" placeholder="Container No." tabindex="24"/>
					</td>
					<th><form:label path="containertypeid"><s:message code="containerForm.containertypeid" /></form:label></th>
					<td>
						<form:select path="containertypeid" cssClass="input-large" tabindex="9">
							<form:option value="">-SELECT-</form:option>
							<form:options items="${containersizeList}" itemLabel="formvalue" itemValue="codetableid" />
						</form:select>
					</td>
					<th><form:label path="customsealno"><s:message code="containerForm.customsealno"/></form:label></th>
					<td>
						<form:input path="customsealno" cssClass="input-large" id="customsealno" maxlength="20" size="20" type="text" placeholder="Custom Seal No" tabindex="24"/>
					</td>
				</tr>
				<tr>
					<th><form:label path="stuffingdate"><s:message code="containerForm.stuffingdate"/></form:label></th>
					<td>
						<form:input path="stuffingdate" cssClass="input-large" id="stuffingdate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="icdstuffdate"><s:message code="containerForm.icdstuffdate"/></form:label></th>
					<td>
						<form:input path="icdstuffdate" cssClass="input-large" id="icdstuffdate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="agentsealno"><s:message code="containerForm.agentsealno"/></form:label></th>
					<td>
						<form:input path="agentsealno" cssClass="input-large" id="agentsealno" maxlength="20" size="20" type="text" placeholder="Agent Seal No" tabindex="24"/>
					</td>
				</tr>
				<tr>
					<th><form:label path="loadlistdate"><s:message code="containerForm.loadlistdate"/></form:label></th>
					<td>
						<form:input path="loadlistdate" cssClass="input-large" id="loadlistdate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="hazapprovaldate"><s:message code="containerForm.hazapprovaldate"/></form:label></th>
					<td>
						<form:input path="hazapprovaldate" cssClass="input-large" id="hazapprovaldate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="dgsubmitdate"><s:message code="containerForm.dgsubmitdate"/></form:label></th>
					<td>
						<form:input path="dgsubmitdate" cssClass="input-large" id="dgsubmitdate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
				</tr>
				<tr>
					<th><form:label path="dispatchdate"><s:message code="containerForm.dispatchdate"/></form:label></th>
					<td>
						<form:input path="dispatchdate" cssClass="input-large" id="dispatchdate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="gateindate"><s:message code="containerForm.gateindate"/></form:label></th>
					<td>
						<form:input path="gateindate" cssClass="input-large" id="gateindate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="polid"><s:message code="jobRegisterForm.polid" /></form:label></th>
					<td>
						<form:select path="polid" cssClass="input-large" tabindex="9">
							<form:option value="">-SELECT-</form:option>
							<form:options items="${portList}" itemLabel="portname" itemValue="portid" />
						</form:select>
					</td>
					
				</tr>
				<tr>
					<th><form:label path="prealertsentdate"><s:message code="containerForm.prealertsentdate"/></form:label></th>
					<td>
						<form:input path="prealertsentdate" cssClass="input-large" id="prealertsentdate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="pickupdate"><s:message code="containerForm.pickupdate"/></form:label></th>
					<td>
						<form:input path="pickupdate" cssClass="input-large" id="pickupdate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="podid"><s:message code="containerForm.podid" /></form:label></th>
					<td>
						<form:select path="podid" cssClass="input-large" tabindex="12">
							<form:option value="">-SELECT-</form:option>
							<form:options items="${portList}" itemLabel="portname" itemValue="portid" />
						</form:select>
					</td>
					
				</tr>
				<tr>
					<th><form:label path="destdestuffDate"><s:message code="containerForm.destdestuffDate"/></form:label></th>
					<td>
						<form:input path="destdestuffDate" cssClass="input-large" id="destdestuffDate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="destuffdate"><s:message code="containerForm.destuffdate"/></form:label></th>
					<td>
						<form:input path="destuffdate" cssClass="input-large" id="destuffdate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
					<th><form:label path="pfdid"><s:message code="containerForm.pfdid" /></form:label></th>
					<td >
						<form:select path="pfdid" cssClass="input-large" tabindex="15">
							<form:option value="">-SELECT-</form:option>
							<form:options items="${portList}" itemLabel="portname" itemValue="portid" />
						</form:select>
					</td>
				</tr>
				<tr>
					<th><form:label path="returntolinedate"><s:message code="containerForm.returntolinedate"/></form:label></th>
					<td colspan="5">
						<form:input path="returntolinedate" cssClass="input-large" id="returntolinedate" maxlength="10" size="10" type="text" placeholder="DD/MM/YYYY" />
					</td>
				</tr>
				<tr>
					<th><form:label path="onboardvesselid"><s:message code="containerForm.onboardvesselid"/></form:label></th>
					<td>
						<form:select path="onboardvesselid" cssClass="input-xalarge" tabindex="27" onchange="javascript: updateVoyageInfo(this);">
							<form:option value="">-SELECT-</form:option>
							<form:options items="${voyageList}" itemLabel="vesselVoyagePOL" itemValue="voyageid" />	
						</form:select>
					</td>
					<th><form:label path="onboardvesselid"><s:message code="jobRegisterForm.cutoff"/></form:label></th>
					<td>
						<input id="cutoff" class="input-large" type="text" placeholder="DD/MM/YYYY"/>
					</td>
					<th><form:label path="onboardvesselid"><s:message code="jobRegisterForm.etd"/></form:label></th>
					<td>
						<input id="etd" class="input-large" type="etd" placeholder="DD/MM/YYYY"/>
					</td>
				</tr>
			</table>
			<br>
			<button class="btn btn-primary" type="submit" formaction="EditContainer" formmethod="post" tabindex="28"><s:message code="add.edit" /></button>
			<button class="btn" type="submit" formaction="ListContainer" form="cancelForm" formmethod="get" tabindex="29"><s:message code="app.cancel" /></button>
		</form:form>
	</div>
	<div id="clientAddEditScreenHolder" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	</div>
</body>
</html>